﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using XRoute.DataExchange;

namespace XRoute.TestClient
{
    class TestProgram
    {
        static void Main(string[] args)
        {
            var factory = new DuplexChannelFactory<IDataExchangeService>(
                new ServiceCallback(),
                "DataExchangeService_DefaultEndpoint");

            var channel = factory.CreateChannel();

            TestService(channel).Wait();
        }

        static async Task TestService(IDataExchangeService dex)
        {
            var sid = await dex.ConnectAsync("TestClient");
            var document = await dex.GetBoardAsync(sid);
            dex.Disconnect(sid);
        }
    }

    class ServiceCallback : IDataExchangeServiceCallback
    {
        public void NotifyDocument(BoardContract document)
        {
        }
    }
}
